<script setup lang='ts'>
import { ref, reactive } from "vue";
import useInstance from "@/hooks/useInstance";
defineOptions({
    name: "inventory",
});

const emit = defineEmits(["refresh"]);
const { global } = useInstance();
const dialogBasic = ref({
    title: "库存查看",
    visible: false,
    width: 800,
    height: 420,
    showFooter: false,
    marginTop: "10vh",
});


const pageParams = ref({
    total:0,
    tableHeight:400,
    tableData:[] as any,
    loadIng:false,
})
const tableProp = reactive(
        {
            name: "inventoryList",
            propsList: [

                {
                    prop: 'reductionVoucherCode',
                    label: '立减金编码',
                    type: 'normal',
                    minWidth: '150px',
                    hidden: true,
                },
                {
                    prop: 'quotaOpType',
                    label: '配额类型',
                    type: 'normal',
                    minWidth: '100px',
                    hidden: true,
                },
                {
                    prop: 'quota',
                    label: '配额',
                    type: 'normal',
                    minWidth: '170px',
                    hidden: true,
                },
      
                {
                    prop: 'quotaOpTime',
                    label: '操作时间',
                    type: 'normal',
                    minWidth: '100px',
                    hidden: true,
                },
          
            
            ]
        })

//显示弹框
const show = (type: string, row?: any) => {
    
    dialogBasic.value.visible = true;
    pageParams.value.tableData = row

};
const onClose = () => {
    dialogBasic.value.visible = false;

};
const onConfirm = async () => {
    onClose();
};
const handPage=()=>{}
defineExpose({
    show,
});
</script>

<template>
    <SysDialog :title="dialogBasic.title" :width="dialogBasic.width" :height="dialogBasic.height"
        :show-footer="dialogBasic.showFooter" :visible="dialogBasic.visible" :margin-top="dialogBasic.marginTop"
        @on-close="onClose" @on-confirm="onConfirm">
        <template v-slot:content>
            <div class="channel-form">
                <OnlyTable class="card-2" :tableProps="tableProp" :pageTotal="pageParams.total" @get-page="handPage"
                    :tableData="pageParams.tableData" :tableHeight="pageParams.tableHeight"
                    :loading="pageParams.loadIng">
              
                </OnlyTable>
            </div>

        </template>
    </SysDialog>
</template>

<style lang='scss' scoped>
.channel-form {
    max-height: 600px;
    overflow: auto;
}
</style>
